def handle_line(line):
    res = ""
    line_block = line.split(':')
    line_block = [l.strip() for l in line_block]
    if len(line_block) == 2:
        res = "\""+line_block[0]+"\":\""+line_block[1]+"\",\n"
    return res


if __name__ == '__main__':
    input_text = './row.txt'
    output_text = './head_handled.txt'
    with open(input_text, 'r') as f:
        lines = f.readlines()
    with open(output_text, 'w') as f:
        for line in lines:
            line = handle_line(line)
            f.write(line)
    print('Finished')

